

$(function(){
	
	var doAdmin=1;
$("#sousuo1").click(function(){
			doAdmin=1;
			diaoyong()
})
	$("#sousuo2").click(function(){
			doAdmin=2;
			diaoyong()
})
	$("#sousuo3").click(function(){
			doAdmin=3;
			diaoyong()
})
	$("#sousuo4").click(function(){
			doAdmin=4;
			diaoyong()
})
    
    
	function diaoyong(){
		$.ajax({
			type:"post",
			url:"https://jindi163.com:8443/JDLot/admin/log/info",
			data:{
			doAdmin:doAdmin,
			pageNum:1,
			pageSize:10
		},
		   xhrFields: {
   				 withCredentials: true
				},
			crossDomain: true,
			dataType:'json',
			contentType:"application/json",
		success:function(data){
			var data= data.datas;
			
  var nums = 5; //每页出现的数量
var pages = Math.ceil(data.length/nums); //得到总页数

var thisDate = function(curr){
    //此处只是演示，实际场景通常是返回已经当前页已经分组好的数据
    var str = '', last = curr*nums - 1;
    last = last >= data.length ? (data.length-1) : last;
    var htmlp='<li  style="border:red 1px solid;font-weight:bolder"><span>操作时间</span><span>管理员</span><span>用户账号</span><span>操作ip</span><span>操作方式</span></tr>';

    for(var i = (curr*nums - nums); i <= last; i++){
    				var item=data[i];
					var oDate = new Date(item.doTime),    
		            oYear = oDate.getFullYear(),    
		            oMonth = oDate.getMonth()+1,    
		            oDay = oDate.getDate(),    
		            oHour = oDate.getHours(),    
		            oMin = oDate.getMinutes(),    
		            oSen = oDate.getSeconds(),    
		            doTime = oYear +'-'+ getzf(oMonth) +'-'+ getzf(oDay) +'-'+ getzf(oHour) +':'+ getzf(oMin) +':'+getzf(oSen);//最后拼接时间    
	 
			        //补0操作    
			        function getzf(num){    
			            if(parseInt(num) < 10){    
			                num = '0'+num;    
			            }    
			            return num;    
			        }  
			        
			        var doAdmin =data[i].doAdmin;
			        if(doAdmin==1){
			        	doAdmin="登录"
			        }else if(doAdmin==2){
			        	doAdmin="删除用户"
			        }else if(doAdmin==3){
			        	doAdmin="修改密码"
			        }else{
			        	doAdmin="充值积分"
			        }
			        
			       var    uid=data[i].uid;

			        if (uid==undefined) {
			        	uid=""
			        } else{
			       	uid=data[i].uid;
			        }
        str += '<li style="border-bottom:red 1px solid;"><span>'+doTime +
         '</span><span>'+data[i].doPhone+
        '</span><span>'+uid+
        '</span><span>'+data[i].doIp+
        '</span><span>'+doAdmin+
        '</span></li>';
    }
    str=htmlp+str;
    return str;
};

//调用分页
laypage({
    cont: 'biuuu_city',
    pages: pages,
    jump: function(obj){
        document.getElementById('biuuu_city_list').innerHTML = thisDate(obj.curr);
    }
})
}
})
}
	})
